<template>
	<view class="container">
		<m-tabbar native>
		    <template v-slot:tabbar_index_1> 
		        <view class="custom_style">
		            <view class="custom_style_icon">+</view>
		        </view>
		    </template>
		</m-tabbar>
		<view class="top-bg"><image src="https://m.nocexpo.com/statics/js/modules/h5/img/beijing.png" mode="widthFix"></image></view>
		<view class="head">
			<view class="user" @click="toUpdateInfo()">
				<image class="avatar" :src="currentUser.portrait ? currentUser.portrait :'/static/image/wutouxiang.png'" />
				<view class="info">
					<view class="name">
						<view @click="toUpdateInfo()">{{!register ? currentUser.userName : '未登录'}}</view>
					</view>
					<view class="status" style="display: flex">
						<view style="float: left;margin-top: 7rpx;" v-show="currentUser.ifMember == 1 && judgeIfSupplier()"  >
							<image style="width: 35rpx;height: 38rpx" src="https://m.nocexpo.com/statics/js/modules/h5/img/demandVipMy.png" mode="widthFix"/>
						</view>
						<view style="display: flex;margin-right: 13rpx;width:auto;">
							<img  style="width: 32rpx;height: 34rpx" src="https://m.nocexpo.com/statics/js/modules/h5/img/zuo.png" mode="widthFix">
							<view class="bgc" style="max-width: 240rpx;text-overflow: ellipsis;white-space: nowrap;overflow: hidden;" v-if="currentUser.company != null">{{currentUser.company}}</view>
						</view>
						<view style="float: left;">
							<img src="https://m.nocexpo.com/statics/js/modules/h5/img/chongzhi.png" style="width: 80rpx; height: 34rpx;"/>
						</view>
					</view>
				</view>
			</view>
			<navigator v-if="judgeIfSupplier()" :url="'/pages/product/showroom/showroom?userId='+currentUser.id" class="btn" style="margin-top: -40rpx;">进入展厅</navigator>
			<navigator v-else class="btn" @click="toAnchorHomepage(currentUser.id)" style="margin-top: -40rpx;">个人主页</navigator>
		</view>
		<view v-if="currentUser.ifMember == 1" class="header-b" style="height:35rpx;margin:-20rpx 0 14rpx 154rpx;font-size: 23rpx;justify-content: start;display: flex;z-index: 3;">
			<view v-if="currentUser.remainDays == null" style="display: flex;z-index: 3;">剩余会员需求数：<view style="color:rgba(236,39,20,1);">{{currentUser.remainNumber}}</view></view>
			<view v-else style="display: flex;z-index: 3;">剩余天数：<view style="color:rgba(236,39,20,1);">{{currentUser.remainDays}}</view></view>
		</view>
		<view class="attr">
			<view class="item" @click="myAttention()">
				<view class="num">{{attentionCount}}</view>
				<view class="text">我的关注</view>
			</view>
			<view class="item" @click="myfan()">
				<view class="num">{{attentionMineCount}}</view>
				<view class="text">粉丝</view>
			</view>
			<view class="item" @click="toProductCollect()">
				<view class="num">{{collectionCount}}</view>
				<view class="text">收藏</view>
			</view>
			<!-- <view class="item"  @click="toMatch()">
				<view class="num">{{demandCount}}</view>
				<view class="text">我的需求</view>
			</view> -->
      <view class="item" v-if="judgeIfSupplier()" @click="toInquiryList()">
        <view class="num">{{inquiryCount}}</view>
        <view class="text">询价单</view>
      </view>
		</view>

		<view class="add_gys" v-if="ifBecomeMember == 1 && judgeIfSupplier()">
      <image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/demand_package.png" mode="widthFix" @click="toBuyMember()" />
    </view>
    <view class="add_gys" v-else>
      <image class="img" v-if="register" src="https://m.nocexpo.com/statics/js/modules/h5/img/jiaru.png" mode="widthFix" @click="becomeSupplier()" />
    </view>
		<view class="module add_module" >
			<view class="title">我的管理</view>
			<view class="menu" style="display: flex;flex-wrap: wrap; width: 100%;">
				<!-- <view class="item">
					<image class="img"  @click="toCollect()" src="https://m.nocexpo.com/statics/js/modules/h5/img/shoucang.png" mode="widthFix" />
					<view class="text">收藏</view>
				</view> -->
				<view class="item item_block" v-if="judgeIfSupplier()" width="150rpx">
					<image class="img" @click="tojiedan()" src="https://m.nocexpo.com/statics/js/modules/h5/img/item1.png" mode="widthFix" />
					<view class="text">我的接单</view>
				</view>
				<view class="item item_block" width="150rpx">
					<image class="img" @click="toMatch()" :src="imgUrl + '/statics/js/modules/applet/img/item2.png'" mode="widthFix" />
					<view class="text">我的需求</view>
				</view>
				<view class="item item_block"  width="150rpx">
					<image class="img" @click="toPersonalVideo()" src="https://m.nocexpo.com/statics/js/modules/h5/img/xiaoshipin.png" mode="widthFix" />
					<view class="text">小视频</view>
				</view>

				<view class="item item_block"  width="150rpx" @click="toPersonalNews()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/dontai.png" mode="widthFix" />
					<view class="text">动态</view>
				</view>

				<view class="item item_block"  width="150rpx" @click="toTicket()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/zhanhui.png" mode="widthFix" />
					<view class="text">展会门票</view>
				</view>
				<view class="item item_block"  width="150rpx" @click="toorderCenter()" v-if="isVisible">
					<image class="img" :src="imgUrl + '/statics/js/modules/applet/img/orderfood.png'" mode="widthFix" />
					<view class="text">展会订餐</view>
				</view>
			</view>
		</view>
		<view class="module">
			<view  style="display: flex; justify-content:space-between;" >
			<view class="title">订单中心</view>
			<view class="title2" @click="tomyorder()">全部></view>
			</view>
			<view class="menu">
				<view class="item" @click="toMyGold()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/yue.png" mode="widthFix" />
					<view class="text">我的余额</view>
				</view>
				<view class="item" @click="tomydaifukuan()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/dingdan.png" mode="widthFix" />
					<view class="text">待付款</view>
				</view>
				<view class="item" @click="tomydaifahuo()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/dingdan.png" mode="widthFix" />
					<view class="text">待发货</view>
				</view>
				<view class="item" @click="tomydaishouhuo()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/dingdan.png" mode="widthFix" />
					<view class="text">待收货</view>
				</view>
				<view class="item">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/dingdan.png" mode="widthFix" />
					<view class="text">退款/售后</view>
				</view>
			</view>
		</view>

    <view class="module" v-if="judgeIfSupplier()">
      <view class="title">展厅管理</view>
      <view class="menu">
        <view class="item" @click="toHomeBrowse()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{homeBrowseCount!==0?homeBrowseCount:0}}</view>
          <view class="text">展厅浏览</view>
        </view>
        <view class="item" @click="toProductBrowse()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{browseMineCount!==0?browseMineCount:0}}</view>
          <view class="text">商品浏览</view>
        </view>
        <view class="item" @click="toCommunication()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{msgCount+phoneCount!==0?msgCount+phoneCount:0}}</view>
          <view class="text">沟通量</view>
        </view>
        <view class="item" @click="toMyLiveCount()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{watchMyLiveCount!==0?watchMyLiveCount:0}}</view>
          <view class="text">直播观看</view>
        </view>
      </view>

      <view class="menu">
        <view class="item" @click="toProductCollect()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{collectionMineCount!==0?collectionMineCount:0}}</view>
          <view class="text">收藏量</view>
        </view>
        <view class="item" @click="toTagsMine()">
          <view style="font-weight: 700;font-size: 32rpx; height: 56rpx; line-height: 56rpx;">{{likeMineCount!==0?likeMineCount:0}}</view>
          <view class="text">获赞量</view>
        </view>
        <view class="item" @click="toProduct()">
          <image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/chanpinguanli.png" mode="widthFix" />
          <view class="text">产品管理</view>
        </view>
        <view class="item" @click="toSamplebook()">
          <image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/yangceguanli.png" mode="widthFix" />
          <view class="text">样册管理</view>
        </view>
      </view>
    </view>
		
		<view class="module fuwu">
			<view class="title">服务大厅</view>
			<view class="menu">
				<view class="item" @click="toService()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/she.png" mode="widthFix" />
					<view class="text">平台客服</view>
				</view>
				<!-- <view class="item" @click="toPolicyService()">
					<image class="img" :src="imgUrl + '/statics/js/modules/applet/img/fuwu.png'" mode="widthFix" />
					<view class="text">政策服务</view>
				</view> -->
				<view class="item">
					<image @click="toGuideList()" class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/caozuozhinan.png" mode="widthFix" />
					<view class="text">操作指南</view>
				</view>
				<view class="item" @click="toSetup()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/she.png" mode="widthFix" />
					<view class="text">设置</view>
				</view>
				<view class="item" @click="toSetup()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/she.png" mode="widthFix" />
					<view class="text">发票申请</view>
				</view>
				<view class="item" @click="toSetup()">
					<image class="img" src="https://m.nocexpo.com/statics/js/modules/h5/img/she.png" mode="widthFix" />
					<view class="text">地址管理</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import personalApi from '@/api/personal.js';
import commonMethod from '@/utils/commonMethod.js';
import indexApi from '@/utils/request/index.js';
import commonApi from '@/utils/commonMethod.js';

export default {
  data() {
    return {
      register: false,//登录
      userAuditPopShow: false,//恭喜成为供应商弹窗
      currentUser: {},
      collectionCount: '0',//收藏量
      browseCount: '',//浏览量
      msgCount: '',//评论量
      attentionCount: '0',//关注量
      tagsCount: '0',//点赞量

      demandCount: '',//发布需求量
      inquiryCount: '',//询价单数量

      homeBrowseCount: '',//展厅首页浏览量
      watchMyLiveCount: '',//直播观看量
      browseMineCount: '',//被浏览量(供应商)
      collectionMineCount: '',//被收藏量(供应商)
      msgMineCount: '',//在线沟通数量(供应商)
      likeMineCount: '',//被点赞数(供应商)
      attentionMineCount: '0',//粉丝数(供应商)
      phoneCount: '',//电话沟通数量
      msg: '',
      myNavIndex: 0,  //导航状态 0.收缩  1.展开
      unread: 0,
      configs: [],
      config: '',
      unreadInquiryCount: '',
      ifBecomeMember: '',

      startTime: '', //进入页面时间
      endTime: '',//离开页面时间
      currentUrl: '',//当前页面全路径
      imgUrl: indexApi.baseUrl,
	  isVisible: true
    };
  },
  onShow() {
    setTimeout(() => {
      if (getApp().globalData.onShow) {
        getApp().globalData.onShow = 0;
        console.log("demo前后台切换之切到前台")
      } else {
        console.log("demo页面被切换显示")
        this.startTime = +new Date();
      }
    }, 100);
  },
  onHide() {
    setTimeout(() => {
      var that = this
      if (getApp().globalData.onHide) {
        getApp().globalData.onHide = 0;
        console.log("还在当前页面活动")
      } else {
        that.endTime = +new Date();
        console.log("demo页面停留时间：" + (that.endTime - that.startTime))
        var stayTime = Math.round((that.endTime - that.startTime) / 1000);
        //这里获取到页面停留时间stayTime，然后了可以上报了
        this.saveFootPrint(stayTime);
      }
    }, 100)
  },
  async mounted() {
    //判断是否登录
    this.register = await commonMethod.getUserLoginFlag();
    console.log('=========', this.register);
	
    /*
    if (this.register) {
      // 跳转登录
      uni.redirectTo({
        url: '/pages/account/login/login'
      })
      return;
    }*/
    const pages = getCurrentPages()
    const currentPage = pages[pages.length - 1]
    this.currentUrl = currentPage.$page.fullPath

    //获取当前用户
    const currentPromise = await commonMethod.currentUserAxios()
    this.currentUser = currentPromise.data.session_user_h5

    //获取系统参数管理
    const configList = await commonMethod.getConfig()
    this.configs = configList.data.list;
	this.isVisible = false;
    for (var i = 0; i < this.configs.length; i++) {
      if (this.configs[i].paramKey == "become_exhibition") {
        this.config = this.configs[i].paramValue;
      } else if (this.configs[i].paramKey == "become_member") {
        this.ifBecomeMember = this.configs[i].paramValue;
      }else if (this.configs[i].paramKey == "if_show_meal") {
        if (this.configs[i].paramValue == 1) {
              this.isVisible = true; // 
        }
    }
	}

    //应商审核通过弹窗
    if (this.currentUser.isAuditPop == 1) {
      this.userAuditPopShow = true
    } else {
      this.userAuditPopShow = false
    }
	
	//判断展会订餐是否回显
  //   if (configList.data.list[i].paramValue == if_show_meal) {
		
  //      this.isVisible = true;
  //   } else {
	 //   this.isVisible = false;
  //   }

    //获取发布的需求数量
    const demandCount = await personalApi.getDemandCount(this.currentUser.id)
    if (demandCount.data.code === 0) {
      this.demandCount = demandCount.data.count
    }

    //获取我的收藏
    const res = await personalApi.getCollectionAxios(this.currentUser.id)
    if (res.data.code === 0) {
      this.collectionCount = res.data.countAndList.count
    }
    //获取粉丝数
    const attentionMineCountRes = await commonMethod.getCollectMineByType(this.currentUser.id, [3])
    if (attentionMineCountRes.data.code === 0) {
      this.attentionMineCount = attentionMineCountRes.data.countAndList.count
    }

    //获取关注人数量
    this.getCollectionCountByType(3)

    //获取未读询价数量
    this.getInquiryList()

    //todo 如果是供应商,获取被收藏数、被浏览量、被点赞数
    if (this.currentUser.type === 1) {
      this.getUnread();

      //获取询价单数量
      const inquiryCount = await personalApi.getInquiryCount(this.currentUser.id)
      if (inquiryCount.data.code === 0) {
        this.inquiryCount = inquiryCount.data.count
      }

      //获取被浏览量(产品)
      const pcCount = await commonMethod.getBrowseMineByType(this.currentUser.id, [1])
      if (pcCount.data.code === 0) {
        this.browseMineCount = commonMethod.handlePrice(pcCount.data.countAndList.count)
      }
      //获取被点赞，10 动态点赞，5视频点赞
      const likeMineCountRes = await commonMethod.getCollectMineByType(this.currentUser.id, [5, 10])
      if (likeMineCountRes.data.code === 0) {
        this.likeMineCount = (likeMineCountRes.data.countAndList.count)
      }
      //获取被收藏量(产品和需求)  type=1 产品收藏量， type=2 需求收藏量
      const collectionMineCountRes = await commonMethod.getCollectMineByType(this.currentUser.id, [1])
      if (collectionMineCountRes.data.code === 0) {
        this.collectionMineCount = commonMethod.handlePrice(collectionMineCountRes.data.countAndList.count)
      }
      //获取展厅首页浏览量
      const homeBrowseCountRes = await commonMethod.getBrowseMineByType(this.currentUser.id, [3])
      if (homeBrowseCountRes.data.code === 0) {
        this.homeBrowseCount = commonMethod.handlePrice(homeBrowseCountRes.data.countAndList.count)
      }
      //获取直播观看量
      const watchMyLiveCountRes = await commonMethod.getBrowseMineByType(this.currentUser.id, [4])
      if (watchMyLiveCountRes.data.code === 0) {
        this.watchMyLiveCount = commonMethod.handlePrice(watchMyLiveCountRes.data.countAndList.count)
      }
      //获取电话沟通数量
      const phoneCountRes = await commonMethod.getBrowseMineByType(this.currentUser.id, [6])
      if (phoneCountRes.data.code === 0) {
        this.phoneCount = phoneCountRes.data.countAndList.count
      }
      //获取在线沟通数量
      const msgCountRes = await commonMethod.getBrowseMineByType(this.currentUser.id, [5])
      if (msgCountRes.data.code === 0) {
        this.msgCount = msgCountRes.data.countAndList.count
      }
      this.msg = commonMethod.handlePrice(this.phoneCount + this.msgCount)
    }
  },

  methods: {
    saveFootPrint(stayTime) {
      commonMethod.saveFootPrint(this.currentUser.id, this.startTime, stayTime, this.currentUrl, "个人中心")
    },
    //登录
    registerClick() {
      window.location.href = '/h5loginByCaptcha.html'
    },
    //关注
    toCollect() {
      uni.navigateTo({
        url: '/pages/person/collect?type=collection'
      })
    },
    // 恭喜成为供应商弹窗
    guanbi() {
      this.userAuditPopShow = false
      cancelUserAuditPop()
    },
    //成为供应商
    becomeSupplier() {
      if (this.currentUser.phone.indexOf("yk") == -1) {
        uni.navigateTo({
          url: '/pages/person/updatePersonInfo?type=becomeExhibition'
        })
      } else {
        const result = commonMethod.judgeIfPhoneNoJudgeLog()
        if (!result) {
          return;
        }
      }
    },

    //根据type获取收藏数量,3.关注人 4.点赞
    async getCollectionCountByType(type) {
      const res = await personalApi.getCollectionCountByTypeAxios(type, this.currentUser.id)
      if (res.data.code === 0) {
        this.attentionCount = res.data.page.totalCount
      }
    },

    getInquiryList() {
      personalApi.getInquiryList(this.currentUser.id).then(res => {
        if (res.data.code === 0) {
          this.unreadInquiryCount = res.data.inquiryCount;
        }
      })
    },

    //登出
    loginOut() {
      axios.get(baseURL + "h5/login/loginOut").then(res => {
        //登录后清除弹窗状态
        localStorage.removeItem("ifPop");
        if (res.data.code === 0) {
          window.location.href = '/logoutloginByCaptcha.html'
        }
      })
    },

    //获取未读消息
    getUnread() {
      personalApi.getUnread(this.currentUser.id).then(res => {
        if (res.data.code === 0) {
          this.unread = res.data.unread
        }
      })
    },
    noDevelopment() {
      layer.open({
        content: "此功能暂未开放，敬请期待",
        btn: ['确定'],
        yes(index) {
          layer.close(index)
        }
      })
    },
    async myAttention() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/myAttention?userId=' + this.currentUser.id
      })
      // window.location.href = "/h5/myAttention.html?userId=" + .currentUser.id;
    },
    async myfan() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/myFan?businessId=' + this.currentUser.id
      })
      // window.location.href = "/h5/myFan.html?businessId=" + vm.currentUser.id;
    },
    async enterPersonal(userId) {
      await this.isLogin();
      window.location.href = '/h5/anchorHomepage.html?userId=' + userId;
    },

    /**
     * 判断是否是供应商
     * @returns {boolean}
     */
    judgeIfSupplier() {
      if (this.currentUser.type == 1 && this.currentUser.state == 1) {
        return true;
      } else {
        return false;
      }
    },
    async toPersonalNews() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/product/imageText/newsBuyers?index=1'
      })
    },
    async toPersonalVideo() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/product/vidoDetail/videoBuyers'
      })
    },
    async toInquiryList() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/product/inquiry/inquiryList'
      })
    },
    async toPersonInfo() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/personInfo'
      })
    },
    async toUpdateInfo() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/updatePersonInfo'
      })
    },
    async toBuyMember() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/need/member/memberDemand'
      })
    },
    async toSetup() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/setup'
      })
    },
    async toGuideList() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/guide/guide'
      })
    },
    async toMatch() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/match'
      })
    },
    async toTicket() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/preTickets'
      })
    },
    async toMyGold() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/myGold'
      })
    },
    async toHomeBrowse() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/browsingHistory?type=homeBrowse'
      })
    },
    async toMyLiveCount() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/browsingHistory?type=watchMyLive'
      })
    },
    async toProductBrowse() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/productView?type=browse'
      })
    },
    async toProductCollect() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/productView?type=collect'
      })
    },
    async toTagsMine() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/followMine?type=tagsMine'
      })
    },
    async toCommunication() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/communicationRecord'
      })
    },
    async toProduct() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/product'
      })
    },
    async toSamplebook() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/statistics/samplebook'
      })
    },
    async tomyorder() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/myOrder'
      })
    },
    async tomydaifukuan() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/mydaifukuan'
      })
    },
    async tomydaifahuo() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/mydaifahuo'
      })
    },
    async tomydaishouhuo() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/mydaishouhuo'
      })
    },
    async toService() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/service'
      })
    },
    async toPolicyService() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/product/showroom/showroom?userId=947231'
        // url: '/pages/product/showroom/showroom?userId=639'
      })
    },

    async tojiedan() {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/wdjiedan'
      })
    },

    async toAnchorHomepage(userId) {
      await this.isLogin();
      uni.navigateTo({
        url: '/pages/person/anchorHomepage?userId=' + userId
      })
    },
	async toorderCenter() {
	  await this.isLogin();
	  uni.navigateTo({
	    url: '/pages/person/orderCenter' 
	  })
	},

    /**
     * 判断是否登录,没登录跳转到登录页
     */
    async isLogin() {
      // debugger
      this.register = await commonMethod.getUserLoginFlag();
      if (this.register) {
        // 跳转登录
        uni.redirectTo({
          url: '/pages/account/login/login'
        })
        return;
      }
    },

    /**
     * 判断用户是否登录
     * @returns {Promise<boolean|*>}
     */
    async userIsLogin() {
      this.register = await commonMethod.getUserLoginFlag();
    },

  }
};
</script>

<style lang="scss" scoped>
	.menu::v-deep{
		.item_block{
			// width: 150rpx !important;
			margin: 10rpx 0;
		}
	}
.container{
	padding-bottom: 110rpx;
}
.top-bg {
	position: relative;
	z-index: 1;
	width: 100%;
	image {
		width: 100%;
		display: block;
	}
}
.head {
	position: relative;
	z-index: 2;
	margin-top: -576rpx;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: $interval;
	.user {
		display: flex;
		align-items: center;
		.avatar {
			width: 108rpx;
			height: 108rpx;
			border-radius: 50%;
			margin-right: 20rpx;
		}
		.info {
			.name {
				font-size: $font-size-max + 4;
				font-weight: bold;
			}
			.status {
				margin-top: 14rpx;
				image {
					margin-right: 16rpx;
					height: 32rpx;
				}
			}
		}
	}
	.btn {
		width: 160rpx;
		line-height: 56rpx;
		text-align: center;
		background: linear-gradient(180deg, #54d6d2 0%, #00aaa6 100%);
		border-radius: 28rpx;
		color: #fff;
	}
}

.attr {
	position: relative;
	z-index: 2;
	display: flex;
	justify-content: center;
	align-items: center;
	.item {
		text-align: center;
    width: 25%;
	}

	.num {
		font-weight: 600;
		font-size: $font-size-max + 2;
	}
	.text {
		margin-top: 5rpx;
		color: $text-color-grey;
		font-size: $font-size-min;
	}
}
.add_gys {
	position: relative;
	z-index: 2;
	margin: 40rpx $interval 0px;
	.img {
		width: 100%;
		height: 100rpx;
	}
}
.module {
	position: relative;
	z-index: 3;
	padding: 24rpx $interval;
	background: #ffffff;
	border-radius: 20rpx;
	margin: 0px $interval 24rpx;
	.title {
		font-size: $font-size-max + 2;
		font-weight: 600;
	}
	.title2{
		color: #BDBDC3;
		font-size:26rpx;
	}
	.menu {
		display: flex;
		text-align: center;
		justify-content: space-between;
		margin-top: 24rpx;
		.item {
		width: 120rpx;
			.img {
				width: 56rpx;
				height: 56rpx;
			}
		}
	}
}

.add_module{
	margin-top: -20rpx;
	.menu {
		.item {
			.img {
				width: 47rpx;
				height: 47rpx;
			}
		}
	}
}
</style>
